from math import *


#1 SUMA DE VECTORES
def sumaVector(A,B):
	s = []
	for i in range(len(A)):
		s.append(A[i]+B[i])
	return s
		
	
print sumaVector([2,3,4],[1,2,3])


#2 RESTA DE VECTORES
def restaVector(A,B):
	r = []
	for i in range(len(A)):
		r.append(A[i]-B[i])
	return r

print restaVector([2,3,4],[1,2,3])


#3 PRODUCTO PUNTO DE VECTORES
def produPunto(A,B):
	p = 0
	for i in range(len(A)):
		p = p + (A[i]*B[i])
	return p
	
print produPunto([1,2,3],[3,2,1])


#4 MULTIPLICACION DE UN VECTOR POR UN ESCALAR
def multiEscalar(A,k):
	r = []
	for i in range(len(A)):
		r.append(k * (A[i]))
	return r
	
print multiEscalar([1,2,3],2)
		

#5 LA NORMA DE UN VECTOR

def normaVector(A):
	r = 0
	for i in range(len(A)):
		r = (r + (A[i]**2))
	return sqrt (r)
	
print normaVector([3,2,1])
		
	
#6 DISTANCIA ENTRE VECTORES

def distanVector(A,B):
	d = 0
	for i in range(len(A)):
		d = (d + ((B[i]**2)-(A[i]**2)))
	return sqrt (d)
	
print distanVector([1,2,3],[2,3,4])
	

	
#7 ANGULO DE UN VECTOR

def anguloVector(A,B):
	num = produPunto(A,B)
	den = normaVector(A)*normaVector(B)
	return acos(num/den)
	
print anguloVector([1,0,0],[0,1,0])
	
	
	
	
	
	
#print anguloVector()


	#return res
	
	#theta = ((acos((punto/((normA)*(normB)))))*180)/(pi)



	
	
		




	

